package com.lyd.nacos.demo.api.controller.v1;

import com.alibaba.cloud.nacos.NacosConfigManager;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Api(tags = "DEMO测试API")
@RestController
@RequestMapping(value = "/hello/nacos")
public class HelloNacosController {
    private final NacosConfigManager nacosConfigManager;

    public HelloNacosController(NacosConfigManager nacosConfigManager) {
        this.nacosConfigManager = nacosConfigManager;
    }

    @GetMapping
    public String helloNacos(){
        return this.nacosConfigManager.getNacosConfigProperties().getName()+",欢迎使用Nacos";
    }
}
